const bar = function (options) {
  return {
    tooltip: {
      trigger: 'axis',
      confine: true,
      axisPointer: {
        type: 'cross',
        label: {
          backgroundColor: '#6a7985'
        }
      }
    },
    legend: {
      right: 0,
      itemWidth: 25,
      itemHeight: 2,
      padding: [7, 0, 0, 0],
      textStyle: {
        color: '#898989'
      }
    },
    grid: {
      left: 40,
      right: 10,
      bottom: 0,
      containLabel: true
    },
    xAxis: [
      {
        type: 'category',
        boundaryGap: false,
        data: options.time,
        axisLine: {
          show: true,
          lineStyle: {
            color: '#adadad',
            width: 2
          }
        },
        axisTick: {
          show: false
        },
        splitLine: {
          show: false,
          lineStyle: {
            color: '#a8c5ed'
          }
        },
        axisLabel:{
          interval:0,
          color: '#939393',
          rotate: '45'
        }
      }
    ],
    yAxis: [
      {
        show: false,
        type: 'value',
        name: '',
        nameTextStyle: {
          color: '#a8c5ed'
        },
        axisLabel: {
          show: false,
          color: '#a8c5ed'
        },
        axisTick: {
          show: false
        },
        axisLine: {
          show: false,
          lineStyle: {
            color: '#214a60',
            width: 2
          }
        },
        splitLine: {
          lineStyle: {
            type: 'dashed',
            color: '#e8e8e8'
          }
        },
        position: 'right'
      }
    ],
    series: [{
      barWidth: 15,
      label: {
        show: true,
        color: '#898989',
        position: 'top'
      },
      itemStyle: {
        color: options.color
      },
      data: options.data,
      type: 'bar'
    }]
  }
};

export default bar
